/**
 * @file memory.h
 * @brief Macros of the memory functions.
 * @date Nov-2011
 * @author Leonardo Lino 2101101
 * @author Joaquim Ferreira 2101104
 * @version 1.0
 */

#ifndef MEMORY_H
#define MEMORY_H

/** @see my_malloc () */
#define MY_MALLOC(size) my_malloc((size),__LINE__,__FILE__)
/** @see my_free () */
#define MY_FREE(ptr) my_free((void **)(&(ptr)),__LINE__,__FILE__)

/**
 * @brief This function alocate memory and check for errors.
 * @fn void *my_malloc(size_t, const int, const char *)
 * @param size The size of type.
 * @param line The line are given by the pre-processor.
 * @param file The file are given by the pre-processor.
 * @return Nothing to return. It's a generic.
 */
void *my_malloc (size_t size, const int line, const char *file);

/**
 * @brief This function free the memory and check for errors.
 * @fn void *my_free(void *, const int, const char *)
 * @param ptr A pointer of pointers.
 * @param line The line are given by the pre-processor.
 * @param file The file are given by the pre-processor.
 * @return Nothing to return.
 */
void my_free (void **ptr, const int line, const char *file);

#endif /* MEMORY_H */
